<?php
	$css_list[0]['url'][] = './tpl/css/article.css';
	$css_list[0]['url'][] = './tpl/css/note.css';
?>
<!--{template inc/header_n}-->
<div class="main_warp">

    <div class="i_inner">
        <div class="product_view">

            <div class="i_lefter">
                <div class="tb-tabbar-inner-wrap">
                    <ul class="tb-tabbar">
                        <li class="selected">
                            <a class="tb-tab-anchor">累计评论</a>
                            <div class="tb-selected-indicator"></div>
                        </li>
                    </ul>
                </div>
                <div class="rate-toolbar">
                    <span class="rate-filter">
                        <input onclick="showcomment(-1)" checked name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>全部({$gradeall})</label>
                        <input id="grade0" onclick="showcomment(0)" name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>好评({$grade0})</label>
                        <input id="grade1" onclick="showcomment(1)" name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>中评({$grade1})</label>
                        <input id="grade2" onclick="showcomment(2)" name="grade" class="rate-list-all rate-radio-group"  type="radio"><label>差评({$grade2})</label>
                    </span>
                </div>
                <div class="tb-revbd">
                    <ul id="grades" class="tb-r-comments">
                        {if !empty($comment_list)}
                        <!--{loop $comment_list $v}-->
                        <li class="tb-r-review grade-{$v['grade']}">
                            <div class="tb-r-buyer"><!--{getuser 1 0 'm' ',avt'}--></div>
                            <div class="tb-r-bd">
                            	<div class="tb-rev-item ">
                            		<div class="tb-r-cnt ">
                            		    <p>{if $v['grade'] == 0}好评{elseif $v['grade'] == 1}中评{else}差评{/if}</p>
                            			{$v['comment']}
                            		</div>
                            		<!--
                            		<div class="tb-r-act-bar">
                            			<div class="tb-r-info">
                            				<span class="tb-r-date">2015年05月11日 10:27</span>
                            			</div>
                            		</div>
                            		<div class="tb-rev-comment">
                            			<div class="tb-r-sns-comment">
                            			</div>
                            		</div>
                            		-->
                            	</div>
                            	{if !empty($v['comment2'])}
                            	<div class="tb-rev-item tb-rev-item-append">
                            		<div class="tb-r-cnt ">
                            			<span class="tb-r-label-append">[追加评论]</span>
                            			{$v['comment2']}
                            		</div>
                            		<div class="tb-rev-comment">
                            			<div class="tb-r-sns-comment">
                            			</div>
                            		</div>
                            	</div>
                            	{/if}
                            </div>
                        </li>
                        <!--{/loop}-->
                        {else}
                        <p><img src="/public/v1/img/zwpj.png"></p>
                        {/if}
                    </ul>
                </div>
            </div>

            <div class="i_righter">
            <!--{template inc/u/u_me_right}-->
            </div>

            <div class="g_clear"></div>

        </div>
    </div>
</div>
<!--{template inc/footer}-->
<script type="text/javascript">

function showcomment(i) {
    if(i == -1)
        $('#grades li').show();
    else {
        $('#grades li').each(function(){
            if($(this).hasClass('grade-'+i))
                $(this).show();
            else
                $(this).hide();
        });
    }
}

{if isset($type)}
$(document).ready(function() {
    $('#grade{$type}').attr('checked', 'checked');
    showcomment({$type});
});
{/if}
</script>
